from flask import Flask
import os
from flask_sqlalchemy import SQLAlchemy

from config import config_map

db =SQLAlchemy()
def create_app(cmp):
    app = Flask(__name__)
    obj = config_map[cmp]
    app.config.from_object(obj)
    db.init_app(app)
    from flask_shop.user import user
    app.register_blueprint(user)
    return app



